package com.jintoufs.service.baseinfo.impl;

import com.jintoufs.dao.QueryFilters;
import com.jintoufs.dao.baseinfo.VendorDAO;
import com.jintoufs.domain.baseinfo.Vendor;
import com.jintoufs.logAnnotation.SystemServiceLog;
import com.jintoufs.service.baseinfo.VendorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service(value = "vendorService")
public class VendorServiceImpl implements VendorService {
    @Autowired
    private VendorDAO vendorDAO;

    @Override
    @SystemServiceLog(description = "获取生产厂商列表")
    public List<Map<String, Object>> getByFilter(QueryFilters filters_) {
        return vendorDAO.getByFilter(filters_);
    }

    @Override
    @SystemServiceLog(description = "删除生产厂商")
    public void delete(Integer id) {
        vendorDAO.delete(id);
    }

    @Override
    @SystemServiceLog(description = "修改生产厂商")
    public void update(Vendor vendor) {
        vendorDAO.update(vendor);
    }

    @Override
    @SystemServiceLog(description = "新增生产厂商")
    public void add(Vendor vendor) {
        vendorDAO.save(vendor);
    }

    @Override
    public List<Vendor> queryByParams(Map<String, Object> params) {
        return vendorDAO.queryByParams(params);
    }
}
